# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=gr-air-modes
pkgver=396.0b6c383
pkgrel=3
pkgdesc='Gnuradio tools for receiving Mode S transponder signals, including ADS-B.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-radio')
url='https://github.com/bistromath/gr-air-modes'
license=('GPL3')
depends=('gnuradio' 'gnuradio-companion' 'gnuradio-osmosdr' 'python2-numpy'
         'python2-scipy' 'python2-pyzmq' 'sqlite' 'libuhd' 'python2-pyqt4'
         'swig' 'boost')
makedepends=('cmake' 'git' 'doxygen')
source=("git+http://github.com/bistromath/$pkgname.git"
        'modes_gui.patch')
sha512sums=('SKIP'
            '0b2149ff9b5b6e198380a01018eb385162493ec6ab813d4c83c46f19987a146a0a30fcc9f60c7c8c68b0ac0c18e5b5b08be9bf11000779d008d2483990cbab52')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  git apply "$srcdir/modes_gui.patch"

  mkdir -p build && cd build
  cmake -DCMAKE_INSTALL_PREFIX=/usr ..
}

build() {
  cd "$pkgname/build"

  make
}

package() {
  cd "$pkgname/build"

  make DESTDIR="$pkgdir" install
}

